﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Infinity.API.DataStructures;

namespace Infinity.API.Core
{
	public class ProjectManager
	{
		protected readonly System.Collections.Generic.List<IDataStructure> m_DataStructures;

		private static ProjectManager m_Instance;

		private ProjectManager()
		{
			m_DataStructures = new System.Collections.Generic.List<IDataStructure>();
		}

		public static ProjectManager Instance
		{
			get
			{
				if (m_Instance == null)
					m_Instance = new ProjectManager();

				m_Instance.Refresh();

				return m_Instance;
			}
		}

		public void Refresh()
		{
			m_DataStructures.RemoveAll(x => x == null);
		}

		public void AddCollection(IDataStructure collection)
		{
			m_DataStructures.Add(collection);
		}
	}
}
